import {View, Text, Alert} from 'react-native';
import React, {useEffect} from 'react';
import Geolocation from '@react-native-community/geolocation';
import UseStorage from './useStorage';
export default function GeolocationCom() {
  useEffect(() => {
    Geolocation.getCurrentPosition(
      info => {
        UseStorage.set('coords', info.coords);
      },
      err => Alert.alert(err.message),
      {timeout: 20000},
    );
  }, []);

  return (
    <View>
      <Text>GeolocationCom</Text>
    </View>
  );
}
